﻿#include <QObject>
#include <QApplication>
#include <QVector>
#include <QDebug>
#include "LicenseWindow.h"
#include "LoginWindow.h"
#include "MainWindow.h"
#include "ICDManagement/ICDManagement.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    LoginWindow loginW;
    LicenseWindow licenseW;
    MainWindow mainW;

    //    licenseW.show();
    loginW.show();
    //    mainW.show();

    // 登录信号与主界面连接
    QObject::connect(&loginW,&LoginWindow::openICDSingal, &mainW, &MainWindow::openICDSlot);
    // 登录主界面后关闭登录界面
    QObject::connect(&mainW,&MainWindow::openICDSuccessSignal, &loginW,&LoginWindow::on_pbExit_clicked);

    // 登录信号与授权界面连接
    QObject::connect(&loginW,&LoginWindow::openLicenseSingal, &licenseW, &LicenseWindow::openLicenseSlot);
    // 登录授权界面后关闭登录界面
    QObject::connect(&licenseW,&LicenseWindow::openLicenseSuccessSignal, &loginW,&LoginWindow::on_pbExit_clicked);

    //授权界面与主界面连接
    QObject::connect(&licenseW,&LicenseWindow::openICDSingal, &mainW, &MainWindow::openICDSlot);
    //登录主界面后关闭授权界面
    QObject::connect(&mainW,&MainWindow::openICDSuccessSignal, &licenseW,&LicenseWindow::on_pbCancle_clicked);

    return a.exec();
}
